const ACCESS_TOKEN_KEY = 'access-token';
const REFRESH_TOKEN_KEY = 'refresh-token';

function getToken() {
  return localStorage.getItem(ACCESS_TOKEN_KEY) || '';
}

function setToken(token) {
  return localStorage.setItem(ACCESS_TOKEN_KEY, token);
}

function clearToken() {
  return localStorage.removeItem(ACCESS_TOKEN_KEY);
}

function getRefresh() {
  return localStorage.getItem(REFRESH_TOKEN_KEY) || '';
}

function setRefresh(token) {
  return localStorage.setItem(REFRESH_TOKEN_KEY, token);
}

function clearRefresh() {
  return localStorage.removeItem(REFRESH_TOKEN_KEY);
}

export { getToken, setToken, clearToken, getRefresh, setRefresh, clearRefresh };
